﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Hired1Div.master" AutoEventWireup="true" CodeBehind="manageJobs.aspx.cs" Inherits="Hired.Admin.WebForm1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <style type="text/css">
.header_myimages
    {
        position: relative;
        float: left;
        margin-left: 10px;
        width: 695px;
        height: 25px;
        background: url(/images/Jobs-text.png) no-repeat;
    }

</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPlaceHolder" runat="server">
    <div class="header_myimages"><div class="headingline"></div></div>
    <div class="line-clear">
    <div class="dataGrid">
        <asp:EntityDataSource ID="entSourceJobs" runat="server" 
            ConnectionString="name=hireddbEntities" DefaultContainerName="hireddbEntities" 
            EnableFlattening="False" EntitySetName="Jobs" 
            
            Select="it.[JobID], it.[CAccountID], it.[Title], it.[Description], it.[MinimumQualifications], it.[EstimatedSalary], it.[WorkingHours], it.[Type], it.[Timestamp], it.[Location], it.[Industry]" 
            AutoGenerateOrderByClause="True">
        </asp:EntityDataSource>
        <asp:GridView ID="gridViewJobs" runat="server" AutoGenerateColumns="False" 
            CellPadding="10" DataSourceID="entSourceJobs" 
            GridLines="Horizontal" AllowSorting="True" 
            onrowcommand="gridViewJobs_RowCommand">
            <AlternatingRowStyle BackColor="#CCCCFF" />
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="JobID" HeaderText="JobID" ReadOnly="True" 
                    SortExpression="JobID" />
                <asp:BoundField DataField="CAccountID" HeaderText="CAccountID" ReadOnly="True" 
                    SortExpression="CAccountID" />
                <asp:BoundField DataField="Title" HeaderText="Title" ReadOnly="True" 
                    SortExpression="Title" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    ReadOnly="True" SortExpression="Description" />
                <asp:BoundField DataField="Industry" HeaderText="Industry" ReadOnly="True" 
                    SortExpression="Industry" />
                
                <asp:TemplateField ShowHeader="False" HeaderText="Delete">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="../images/deleteicon.png"
                                CausesValidation="False" CommandName="Delete" CommandArgument='<%# Eval("JobID") %>' />
                            <asp:Panel ID="pnlDeletePopup" runat="server" CssClass="modalPopup">
                                Are you sure you wish to delete job
                                <asp:Label ID="lbljob" runat="server" Text='<%# Eval("Title") %>' />?
                                <br />
                                <br />
                                <asp:Button ID="btnCancel" Style="float: right" runat="server" Text="Cancel" />
                                <asp:Button ID="btnConfirm" Style="float: right; margin-right: 25px;" runat="server" Text="OK" />
                                <asp:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" ConfirmText=""
                                    Enabled="True" TargetControlID="btnDelete" DisplayModalPopupID="DeleteModalPopupExtender">
                                </asp:ConfirmButtonExtender>
                                <asp:ModalPopupExtender ID="DeleteModalPopupExtender" runat="server" TargetControlID="btnDelete"
                                    DropShadow="True" PopupControlID="pnlDeletePopUp" CancelControlID="btnCancel"
                                    OkControlID="btnConfirm" BackgroundCssClass="modalBackground">
                                </asp:ModalPopupExtender>
                                <br />

                            </asp:Panel>
                        </ItemTemplate>

                    </asp:TemplateField>
                
            </Columns>
            <HeaderStyle BackColor="#9933FF" ForeColor="White" HorizontalAlign="Center" />
            <PagerStyle BackColor="#9900FF" ForeColor="White" />
        </asp:GridView>
    </div></div>
    
</asp:Content>
